#ifndef _CPUPORT_H_
#define _CPUPORT_H_

#include "types.h"

phys_reg_t __arch_interrupt_suspend(void);
void __arch_interrupt_recover(phys_reg_t);

void __arch_context_switch(phys_reg_t from_task, phys_reg_t to_task);
void __arch_context_switch_to(phys_reg_t sp);

void __arch_interrupt_enable(void);
void __arch_interrupt_disable(void);

void __arch_spin_lock(phys_reg_t *lock);
int __arch_spin_trylock(phys_reg_t *lock);
int __arch_spin_unlock(phys_reg_t *lock);

void __arch_atomic_add(phys_reg_t *lock, phys_reg_t value);
void __arch_atomic_sub(phys_reg_t *lock, phys_reg_t value);

#endif
